Giving attributes to an element

If a HTML element has attributes, it can be asked about in two different ways, either in a dialog box with all attributes (the default), or in the status bar. The flag useBigWindows determines which of these two ways you want to use. If useBigWindows is set the attributes will be asked about in a dialog box (the default), and otherwise in the status bar.

The attributes can be divided into eight categories: URLs, colors, target windows, predefined choices (for example ALIGN=LEFT|CENTER|RIGHT), numbers, flags, other and event handlers. The category other contains attributes which can take any value plus some which does not fit into any of the other categories.

Using dialog boxes

The picture above show the dialog box for a made up HTML element I have called ELEMENT, which has one attribute of each kind. If you set the flag inclEventHandler, JavaScript's event handlers will be included in the dialog. By default they are not.

URLs

You can give the URL in three ways:

  1. type the URL in the text box,
  2. choose one from the menu with your URL cache,
  3. select a file via a file dialog. (You are only allowed to select a file in your home page folder.) The file you have selected will be put in the menu.

It is probably much faster to type the URL, than selecting a file from a file dialog, but the advantage about the file dialog is that it will automatically determine the relative path. If you use a BASE element in the current window it will be noticed, and the relative path will be relative to it. If you use the file dialog, you must set your home page folder and if you use the BASE element you must also set your server URL (see the section on how to configure HTML mode). You can only make links to files in the home page folder, or any of its sub folders, because otherwise the relative path would not be possible to determine.

If you type a URL in the text box, it will be used, even if you choose something from the menu.

Colors

You can give the color in three ways:

  1. type a hexadecimal number #RRBBGG, which defines the color, in the text box,
  2. choose a color from the menu,
  3. define a new color. The color so defined will be put in the menu.

If you type something in the text box, it will be used, even if you choose a color from the menu.

Window

You can give the target window in two ways:

  1. type the window name in the text box,
  2. choose a window name from the menu with your window cache.

If you type something in the text box, it will be used, even if you choose a window from the menu.

Predefined choices

Select a choice from the menu.

Numbers

Attributes which take an integer value. The numbers will be checked that they are in the valid range.

Other

Attributes which can take any value. Note that spaces in the beginning and end of what you type are not removed. (This is always done otherwise.) This is because sometimes such spaces are wanted.

Flags

These are attributes which does not take any value. Check the checkbox to use it.

Event handler

Attributes which event handlers for JavaScript. These are only included in the dialog box if the flag inclEventHandler is set. By default they are not.


If an element has very many attributes, the dialog box may have to be divided into two, or possibly three, pages to fit your screen. Then there will be a menu in the upper left corner of the dialog box to switch between the pages, as shown in the picture below. The dialog box is made as large as possible before being split into two or three pages, so if your screen is large enough this will never happen.

Alpha will complain if you forget a required attribute, or give a value to an attribute which is not valid (not true in all cases but there are some controls).

Using the status bar

By default not all attributes are asked about. Use the menu Use Attributes to determine which attributes you want to be asked about. There you can also set a flag 'Ask for more?' for each element. If you answer yes, the following will happen when you are asked about attributes for this element:

The idea is that you can put a kind of half way mark. First you are asked about the ones you always want to be asked about, and then you are optionally asked about the rest. If you set the flag inclEventHandler, JavaScript's event handlers will be asked about for those elements you have set 'Ask for more' to yes.

By default, Alpha beeps for each attribute it asks you about. You can turn off the beeps by unsetting the flag promptNoisily.

For each attribute you will get a prompt in the status bar. When an attribute is optional, "(optional)" is added to the prompt. See the pictures below:


You can simply type the value you want for an attribute (for colors you can either type a number #RRBBGG or a color name), but some keys have special functions to speed up your work.

tab - If you are asked about an attribute with predefined choices, for example ALIGN=LEFT|CENTER|RIGHT, tab will match what you have typed against your options, and complete what you have typed as much as possible. Suppose you type C and then tab. The letters ENTER will then automatically be inserted. The same is true if you are asked for a URL, a target window or a color. Tab will then match against your URL cache, the window cache or the color names defined.

double tab - If there are predefined choices or you are asked for a URL, a color or a target window, double tab will put up a list with everything that match what you have typed so far. If you for example have forgotten which choices there are, hit double tab without typing anything to get a list with all possible choices. Once you have chosen something from the list, Alpha immediately jumps to ask you about the next attribute.

cmd-v - Pastes the clipboard into the status bar. This is most useful if you want to insert a URL which you for example has in another file.

ctrl-f - If you want to select a file via a file dialog, when asked for a URL, or define a new color, when asked for a color, type ctrl-f in the status bar. Once you have selected a file or defined a new color, Alpha immediately jumps to ask you about the next attribute.

escape - Deletes everything written.

ctrl-z - Cancel everything.


If there are predefined choices, only the letters which match a choice can be typed. If you type anything else you just get a beep. Also, if there are predefined choices, and you have typed a unique subset of one of them and hit return, the rest will be added. For example, if the choices are ALIGN=LEFT|CENTER|RIGHT and you type R and then return, you will get ALIGN=RIGHT. If what you have typed is not unique, the attribute will be skipped. There are a few cases when two letters are needed to get a unique choice.

Giving no value at all to an attribute means that you skip it. If you skip a required attribute, no tags will be inserted.